Simplify the logic of each of the functions here, removing the many bizarre
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Thu, 17 Nov 2005 19:17:50 +0000 (20:17 +0100)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Thu, 17 Nov 2005 19:17:50 +0000 (20:17 +0100)
commit2f7678e706d2251c8f0ae1e619128a3770a9b6a1
tree1994921f8949719a1700e71597dcc098e0e5c1c7
parent1055f8d4bedd18d3aa0285059c9df097fc801d1b
Simplify the logic of each of the functions here, removing the many bizarre
uses of goto that reduce down to return NULL in any case, breaking the common
code out for returning values based upon the success or failure of an
operation, and the common code that parses transaction and path parameters,
used by xspy_read, xspy_ls, and xspy_mkdir.  Break out also the common code
that removes a watch token from the XsHandle watches list.

Use bool rather than int for result values, where this matches the same use
by tools/xenstore/xs.c.

Added missing free in xspy_get_permissions.

Use PySequence_SetItem inside xs_watch, rather than Py_INCREF followed by
PyList_SetItem.  If there is no None entry in the watches list, the code goes
on to append to the list using PyList_Append, and that call takes its own
reference rather than stealing one like PyList_SetItem.  This means that we
were previously leaking a reference if the list was full and so PyList_Append
was necessary.

Use PySequence_SetItem rather than Py_INCREF/PyList_SetItem also where we are
using assigning Py_None into the list, for neatness.

Remove meaningless pipe from xspy_release_domain's arg_spec.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/lowlevel/xs/xs.c